State Machine for a pulse output function

ABSTRACT

At least one exemplary embodiment of the present invention includes a system comprising an arithmetic logic unit; a memory comprising a pre-computed table of target pulse widths, changes in pulse width, and pulse counts distributed according to a constrained semi-logarithmic distribution, said memory connected to said arithmetic logic unit via a pipeline mechanism; and a state machine adapted to load each of said target pulse widths and changes in pulse width from said memory into said arithmetic logic unit at pre-determined intervals of pulse count while maintaining control of a pulse width generated by said arithmetic logic unit. It is emphasized that this abstract is provided to comply with the rules requiring an abstract that will allow a searcher or other reader to quickly ascertain the subject matter of the technical disclosure. This abstract is submitted with the understanding that it will not be used to interpret or limit the scope or meaning of the claims.

CROSS REFERENCE TO RELATED APPLICATIONS

[0001] This application claims priority to, and incorporates byreference herein in its entirety, the following pending provisionalapplications:

[0002] Serial No. 60/346,488 (Attorney Docket No. 2002P00150), filed 7Jan. 2002; and

[0003] Serial No. 60/384,979 (Attorney Docket No. 2002P08887US), filed 3Jun. 2002.

BRIEF DESCRIPTION OF THE DRAWINGS

[0004] The invention and its wide variety of potential embodiments willbe readily understood via the following detailed description of certainexemplary embodiments, with reference to the accompanying drawings inwhich:

[0005]FIG. 1 is a flowchart of an exemplary embodiment of a method 1000of the present invention;

[0006]FIG. 2 is a block diagram of an exemplary embodiment of a system2000 of the present invention;

[0007]FIG. 3 is a block diagram of an exemplary embodiment of aninformation device 3000 of the present invention;

[0008]FIG. 4 is a block diagram of an exemplary embodiment of cachebehavior of an exemplary motion module of the present invention;

[0009]FIG. 5 is a reference point seek diagram of an exemplary motionmodule of the present invention;

[0010]FIG. 6 is a reference point seek diagram of an exemplary motionmodule of the present invention;

[0011]FIG. 7 is a reference point seek diagram of an exemplary motionmodule of the present invention;

[0012]FIG. 8 is a reference point seek diagram of an exemplary motionmodule of the present invention;

[0013]FIG. 9 is two reference point seek diagrams of an exemplary motionmodule of the present invention;

[0014]FIG. 10 is a block diagram showing an exemplary arrangement andlabeling of LED's of an exemplary motion module of the presentinvention;

[0015]FIG. 11 is a circuit diagram showing exemplary circuits for inputsand outputs and the associated user power terminals of an exemplarymotion module of the present invention;

[0016]FIG. 12 is a pulse out generation block diagram for an exemplaryembodiment of the motion module;

[0017]FIG. 13 is a graph of frequency versus time for an exemplaryembodiment of the present invention;

[0018]FIG. 14 is a graph of frequency versus time for an exemplaryembodiment of the present invention;

[0019]FIG. 15 is an S-curve graph of frequency versus time for anexemplary embodiment of the present invention.

DETAILED DESCRIPTION

[0020] At least one exemplary embodiment of the present inventionincludes a method comprising obtaining a first position, a secondposition, and a maximum motion parameter for a movement between thefirst position and the second position. The method also comprisescreating a table of values comprising a plurality of target frequenciesfor the movement, the table of values also comprising a pulse width, apulse count, and a differential pulse width corresponding to each of thetarget frequencies from the plurality of target frequencies. The methodalso comprises outputting at least a portion of the values from a pulsegenerator.

[0021] At least one exemplary embodiment of the present inventionincludes a method comprising obtaining a first frequency and a secondfrequency. The method also comprises creating a table of valuescomprising a plurality of target frequencies intermediate to the firstand second frequencies, the table of values also comprising a pulsewidth, a pulse count, and a differential pulse width corresponding toeach of the target frequencies from the plurality of target frequencies.The method also comprises outputting at least a portion of the values toa motion device. The method can also comprise transmitting the at leasta portion of the values over the Internet.

[0022] At least one exemplary embodiment of the present inventionincludes a device comprising a sub-incremental clock-count-derived pulsegenerator. At least one exemplary embodiment of the present inventionincludes a device comprising a pulse generator adapted to produce achange from a first pulse output frequency to a second pulse outputfrequency by interpolating between pre-computed intermediate pulseoutput frequencies, a width of each pulse derived from real-timesub-incremental addition of clock counts during periods of accelerationand deceleration.

[0023] At least one exemplary embodiment of the present inventionincludes a system comprising an arithmetic logic unit. The system alsocomprises a memory comprising a pre-computed table of target pulsewidths, changes in pulse width, and pulse counts distributed accordingto a constrained semi-logarithmic distribution, said memory connected tosaid arithmetic logic unit via a pipeline mechanism. The system furthercomprises a state machine adapted to load each of said target pulsewidths and changes in pulse width from said memory into said arithmeticlogic unit at pre-determined intervals of pulse count while maintainingcontrol of a pulse width generated by said arithmetic logic unit.

[0024]FIG. 1 is a flowchart of an exemplary embodiment of a method 1000of the present invention. In certain embodiments, method 1000 can beutilized in conjunction with a pulse generator that affects a motiondevice. A motion device can be any device capable of being controlled bya variable frequency pulse train, including a motion controller, such asa stepper motor controller, a servo controller, an actuator controller,etc.; a motion drive, such as a stepper drive, servo drive, etc.; and/ora actuator, such as a stepper motor, servomotor, linear motor, motor,ball screw, servo valve, hydraulic actuator, pneumatic valve, etc. It isrecognized that a pulse generator can produce a series of pulses, calleda pulse train. According to certain embodiments of the presentinvention, a variable frequency pulse generator can produce a pulsetrain that can vary in frequency, count, width, and/or differentialwidth (also referred to herein as “change in pulse width”). At themotion device, the frequency of the pulse train can control speed and/orthe pulse count can control position.

[0025] At activity 1100, a motion control profile can be created,potentially by a user of the pulse generator. The user can provide adesired angular and/or linear distance to be traveled and a speed atwhich to cover the distance.

[0026] In certain embodiments, the user can provide a maximum velocity,a maximum acceleration, a maximum change in acceleration with respect totime (sometimes referred to as “jerk” or specified as a “jerk time”),and/or a maximum change in jerk with respect to time. The user candetermine these values deterministically and/or empirically to achievedesired machine movements and/or avoid undesired effects, such as motorstalling, motor slippage, or other motion device problems (e.g., excessstresses, loss of friction between conveyed items and a conveyor belt,flinging of liquids, etc.).

[0027] In response, a motion control profile can be rendered. In certainembodiments, the motion control profile can indicate desired positionsand times for a motion device on a position versus time plot. In otherembodiments, the motion control profile can indicate a desired frequencyramp for a motion device on a frequency versus time plot. Such a motioncontrol profile can include a beginning and an ending frequency, and canbe linear, curvilinear, or a combination of linear and curvilinearportions between the frequencies. Potentially based on the user's input,in some cases the motion control profile can reflect an S-curve, inwhich the “take-off” from the beginning frequency gradually ramps up infrequency change, and the “landing” to the ending frequency graduallyramps down in frequency change, to avoid abruptness in frequency changenear the beginning and ending frequencies. The motion control profilecan be stored as, for example, a table of time-frequency points. Otherpotential plots can include position versus pulse count, frequencyversus pulse count, speed versus time, speed versus position,acceleration versus time, acceleration versus pulse count, accelerationversus position, acceleration versus frequency, and/or accelerationversus speed. Note that a motion control profile can provide expresslycertain motion parameters, and can imply other motion parameters. Forexample, a motion control profile can expressly describe a beginningposition, an ending position, and a time over which a motion between thebeginning and ending positions is to occur, which by implicationdescribes an average velocity for the motion.

[0028] At activity 1200, the motion control profile can be stored, suchas in a memory, for later retrieval. At activity 1300, the motioncontrol profile can be obtained by, for example, a motion controlprocessor of a pulse generator module of a programmable logic controller(“PLC”).

[0029] At activity 1400, the motion control processor can load a firstand second frequency from the motion control profile, and can calculatea plurality of intermediate frequencies. The motion control processorcan seek to adjust the pulse width of each pulse so as to achieve thefrequency (corresponding to speed), acceleration, and/or change inacceleration specifications of the specific application while alsomeeting intermediate and/or total pulse count (corresponding todistance) specifications. Because each pulse has a finite width, andbecause pulse width can vary within a pulse train, new values of pulsewidth can be needed from a few times per second to several hundredthousand or millions of times per second in current typicalapplications.

[0030] For a motion control processor intended to supply a broad varietyof end use needs, the range of motion parameters (e.g., frequencies,accelerations, times, and/or distances, etc.) to be accommodated can berepresented and calculated as floating point values, and/or in aversatile fixed point format with a large number of significant digits.In certain embodiments of the present invention, the values can becomputed before needed and stored in a memory for retrieval and use inreal time.

[0031] At least one embodiment of the present invention can computevalues (e.g., pulse width, change in pulse width, and/or number ofpulses, etc.) associated with a plurality of frequencies intermediate invalue to the first and second frequencies of the motion control profileprior to the start of motion and can store the values in memory. Duringexecution of the motion, these values can be fetched from memory atpre-determined intervals of pulse count. The pulse widths of individualpulses issued during the intervals between fetched values can becomputed as a simple linear addition of a change in pulse width for eachpulse, accomplishing in real time an interpolation between thepre-calculated values of pulse width associated with the plurality ofintermediate frequencies.

[0032] Computation of values prior to the start of motion, whencalculation time is relatively unconstrained, can allow calculation to adesired level of precision with a processor that is limited in size,cost, and/or power. Computation of values associated with a sufficientlysparse plurality of intermediate frequencies can allow storage of thepre-computed data in a memory that is limited in size, cost, and/orpower. In certain cases, changing each pulse width by means of a simpleadditive interpolation between the pre-computed points can allow for acloser approximation to the desired motion control profile than would beachieved by using only the plurality of intermediate frequencies, whilelimiting the cost, size, and/or power of the computing device that isrequired to have a fresh value available for each pulse as it occurs.

[0033] Where a pulse is defined as an event comprising a period of alogical “1” and a logical “0”, simple addition of a constant value tothe pulse width with each pulse produces a non-linear change infrequency, since frequency is the inverse of pulse width. Sustainedaddition of a constant value to the pulse width can produce a markedlycurved change in frequency with respect to time, with low accelerationat low frequency and high acceleration at high frequency. In order toachieve a given desired adherence to the specified frequency profile,the intervals between the points of the plurality of intermediatefrequencies can be controlled, thereby controlling the curvatureproduced by the interpolative addition of a constant to the pulse width.For a constant acceleration region of a profile, said curvature is moremarked at the lower values of frequency. By distributing the intervalsbetween the points of the plurality of frequencies according to asemi-logarithmic progression, (or equivalently, by advancing eachinterval of increasing frequency by an equal predetermined percentage ofthe preceding frequency) a distribution of points can be achievedwhereby more points are placed at the lower values of frequency wheremore attention to curvature control is desired, thus achieving a desiredlevel of adherence to the profile with fewer points than would beachieved by points distributed equally in time.

[0034] Complete adherence to this semi-logarithmic distribution ofpoints can result in very few points at the higher frequency portion ofa frequency change region. For frequency profiles that includecontrolled changes in acceleration (S curves, or controlled “jerk”)sufficient points can be included at the higher frequencies to describe,to the desired level of accuracy, the desired limited change inacceleration between a region of high acceleration and a region of lowacceleration or no acceleration (constant speed). Thus, the increasinginterval between pre-calculated frequency points implied by asemi-logarithmic progression can be constrained, or limited, to providepoints at some maximum interval consistent with representing theanticipated range of curvature desired for the S-curve, or limitedacceleration case.

[0035] Further, there can be practical limits on the minimum intervalbetween points, as required by, for example, a processor interruptresponse time needed to load a new set of values, and/or by therequirement that the realizable intervals be greater than a currentpulse width. Thus, the intervals calculated by the semi-logarithmicdistribution can be examined and suitably constrained to no less thansome minimum quantity determined by the implementing system constraints.

[0036] Each pulse width can be produced by counting out an integralnumber of clock events of some suitably higher frequency master clock,which number of clock events can be the stored representation of pulsewidth value, and each change in pulse width can be produced by adding apositive or negative number to the current value. In order to achievethe desired range of frequencies, accelerations, and/or pulse counts,with a desired level of precision, at least one embodiment of thecurrent invention can represent the change in pulse width with anintegral number of clock events and a sub-integral or fractional partnumber of clock events. A fractional part of a clock event is notnecessarily expressed in a non-integral number of clock events perrealized pulse width, but can be accumulated on each of the pulse widthchange additions for the specified interpolation interval. At such timethat the accumulation of fractional or sub-integral parts exceeds awhole value, this whole value can become part of the expressed number ofintegral clock events per pulse width.

[0037] At activity 1500, any or all of the calculated values can beadjusted to conform to predetermined motion constraints and/orparameters. For the purposes of this application, motion constraints caninclude constraints on frequency, the first derivative of frequency withrespect to time, and/or the second derivative of frequency with respectto time. Motion constraints can also include constraints on angularand/or linear position, velocity, acceleration, jerk (the firstderivative of acceleration with respect to time), and/or the secondderivative of acceleration with respect to time. Note that thoseconstraints that are expressed as derivatives can be approximated usingpredetermined differential values (increments) of time. For example,jerk can be approximated as a maximum allowable acceleration valuedivided by a chosen increment of time. As another example, a specifiedminimum motion time can be followed.

[0038] Motion constraints can apply at any region of the motion controlprofile. For example, when first beginning a change in position of astepper motor shaft, to avoid potential challenges such as slippage,jerk can be limited to a predetermined amount, such as 0.01 radian persecond³ or 0.01 mm per second³.

[0039] At activity 1600, a table can be populated with the calculatedand/or adjusted values. Each row of the table can contain a differentintermediate frequency, each intermediate frequency having acorresponding pulse width, change in pulse width, and/or pulse count.Two adjacent rows can be considered to contain an adjacent pair ofintermediate frequencies.

[0040] At activity 1700, the table can be read by a pulse generator ofthe PLC to output a pulse train. Table values can be provided to amotion control processor of the pulse generator, which can comprise apipeline mechanism, an arithmetic logic unit (“ALU”), and/or acontrolling state machine. The ALU can provide interpolated intermediatevalues of pulse width by adding a supplied positive or negative changein pulse width to each successive pulse width value, for the indicatednumber of pulses. The ALU may add a value representing an integralnumber and a non-integral or fractional number of master clock events,accumulating the fractional number over multiple pulse widths until suchaccumulation exceeds a whole number and is incorporated into theexpressed pulse width. Control of the reading of the table and output ofthe pulse train can be governed by the state machine at predefinedintervals, which intervals can be indefinitely deferred, interrupted,and/or re-initiated by command and/or external event while maintainingcontrol of pulse width.

[0041] At activity 1800, the pulse train can be provided to a motiondevice. The pulse train can be provided via a direct connection to thepulse generator, and/or via a network connection, such as an Internetconnection. The pulse train can be provided as a digital or an analogsignal.

[0042]FIG. 2 is a block diagram of an exemplary embodiment of a system2000 of the present invention. System 2000 can include a programmablelogic controller (“PLC”) 2100 comprising a main processor 2120 coupledvia a connector 2130 to a pulse generator 2140. In certain embodiments,pulse generator 2140 can connect to a connector 2300 such as a systembackplane and/or an expansion input/output bus of PLC 2100.

[0043] Pulse generator 2140 can be integral to PLC 2100. That is, onceinstalled, pulse generator 2140 can be a component of PLC 1100, ratherthan free standing. Pulse generator 2140 can include a motion processor2150 having a memory 2160, such as a dual port RAM. Motion processor2150 can be a commercially available general-purpose microprocessor. Inanother embodiment, motion processor 2150 can be an Application SpecificIntegrated Circuit (ASIC) that has been designed to implement in itshardware and/or firmware at least a part of a method in accordance withan embodiment of the present invention. In yet another embodiment,motion processor 2150 can be a Field Programmable Gate Array (FPGA).

[0044] Memory 2160 can contain instructions that can be embodied insoftware, which can take any of numerous forms that are well known inthe art. Pulse generator 2140 also can include a communicationsinterface 2170, such as a bus, a connector, a telephone line interface,a wireless network interface, a cellular network interface, a local areanetwork interface, a broadband cable interface, etc.

[0045] Pulse generator 2140 can be connected to a motion controller 2300that is separate from PLC 2100. Motion controller 2300 can be connectedto a motion drive and/or an actuator 2400. Pulse generator 2140 also canbe connected via a network 2500 to a motion controller 2600 that isseparate from PLC 2100. Network 2500 can be a public switched telephonenetwork (PSTN), a wireless network, a cellular network, a local areanetwork, the Internet, etc. Motion controller 2600 can be connected to amotion drive and/or an actuator 2700. Further, pulse generator 2140 canbe connected to a motion controller 2180 that is integral to PLC 2100.Motion controller 2180 can be connected to a motion drive and/or anactuator 2200.

[0046] Connected to network 2500 also can be an information device 2900,such as a traditional telephone, telephonic device, cellular telephone,mobile terminal, Bluetooth device, communicator, pager, facsimile,computer terminal, personal computer, etc. Information device 2900 canbe used to program, interact with, and/or monitor pulse generator 2140.

[0047]FIG. 3 is a block diagram of an exemplary embodiment of aninformation device 3000 of the present invention. Information device3000 can represent information device 2900 of FIG. 2. Information device3000 can include well-known components such as one or more networkinterfaces 3100, one or more processors 3200, one or more memories 3300containing instructions 3400, and/or one or more input/output (I/O)devices 3500, etc.

[0048] In one embodiment, network interface 3100 can be a telephone, acellular phone, a cellular modem, a telephone data modem, a fax modem, awireless transceiver, an Ethernet card, a cable modem, a digitalsubscriber line interface, a bridge, a hub, a router, or other similardevice.

[0049] Each processor 3200 can be a commercially availablegeneral-purpose microprocessor. In another embodiment, the processor canbe an Application Specific Integrated Circuit (ASIC) or a FieldProgrammable Gate Array (FPGA) that has been designed to implement inits hardware and/or firmware at least a part of a method in accordancewith an embodiment of the present invention.

[0050] Memory 3300 can be coupled to a processor 3200 and can storeinstructions 3400 adapted to be executed by processor 3200 according toone or more activities of a method of the present invention. Memory 3300can be any device capable of storing analog or digital information, suchas a hard disk, Random Access Memory (RAM), Read Only Memory (ROM),flash memory, a compact disk, a digital versatile disk (DVD), a magnetictape, a floppy disk, and any combination thereof.

[0051] Instructions 3400 can be embodied in software, which can take anyof numerous forms that are well known in the art.

[0052] Any input/output (I/O) device 3500 can be an audio and/or visualdevice, including, for example, a monitor, display, keyboard, keypad,touchpad, pointing device, microphone, speaker, video camera, camera,scanner, and/or printer, including a port to which an I/O device can beattached or connected.

[0053] Certain exemplary embodiments of the present invention include aposition or motion module that connects a PLC to stepper motor via astepper drive controller. Certain exemplary embodiments of this moduleare sometimes referred to herein as the EM 253 Motion Module. Certainexemplary embodiments of the PLC are sometimes referred to herein as theS7-200. Certain exemplary embodiments of the stepper motor are sometimesreferred to herein as the Simostep P50 motor. Certain exemplaryembodiments of the stepper drive controller are sometimes referred toherein as the Simodrive FM Step Drive.

[0054] Features of the EM 253 Motion Module

[0055] The EM 253 Motion Module can identify itself as an S7-200intelligent module and can provide local inputs and outputs forinterfacing with, for example, a single axis stepper motor as specifiedherein.

[0056] Communication between the module and the S7-200 PLC can betransacted over the Expansion I/O bus. The appropriate hardware can beprovided in order to support communication initiated by either the PLCor the module.

[0057] The EM 253 Motion Module can provide the pulse outputs for motioncontrol from 12 pulses per second (pps) to 200K pulses per second (pps).In the event that this span of pulse rates cannot be provided as asingle range, the module firmware can automatically select the operatingrange based upon the maximum speed specified in the moduleconfiguration. Based upon the maximum speed (MAX_SPEED) the module cancompute the minimum speed (MIN_SPEED) for that range. The followingranges can be supported: Speed Range MIN_SPEED MAX_SPEED up to 2K pps 12pps MAX_SPEED up to 10K pps 60 pps MAX_SPEED up to 50K pps 300 pps MAX_SPEED up to 200K pps 1200 pps 

[0058] Programming Interface to the EM253 Motion Module

[0059] The S7-200 programming software can provide three functions toaid module configuration, profile creation, and module operation(control and status monitoring).

[0060] The configuration function can prompt the user to enter therequired parameters. Then the profile creation function can prompt theuser for the required information for each move profile. The informationfor each move profile can then be converted into a sequence of stepswith a move identification number. Once the user has entered theinformation for the configuration and all the move profiles, thesequence of steps for each move can be combined into a single table asspecified herein. The pointer to the V memory table can be stored in thesection of the SDB provided for the module. Then both the data block forV memory and the SDB can be downloaded to the PLC.

[0061] A library instruction using the PCALL instruction and itscorresponding subroutine can be provided as a standard function forcontrolling the module's operation. The user can be able to monitor themodule's operation by enabling execution status of the libraryinstruction.

[0062] Expansion I/O Bus Interface

[0063] The module can provide a ten-pin ribbon cable for connection tothe expansion I/O bus interface on the PLC or previous I/O expansionmodule. It can also provide a ten-pin ribbon cable connector (male) intowhich another I/O expansion module can be connected. The module canreturn the ID code 0×21 which identifies the module as:

[0064] (a) An intelligent module

[0065] (b) Discrete I/O

[0066] (c) No inputs

[0067] (d) With 8 discrete outputs

[0068] The module can provide a dual port RAM through whichcommunication with the PLC can be accomplished. Configurationinformation for the module can be accessed using either the MPI or themore efficient Block Data Transfer. The module can utilize a maximum ofone MPI request and/or multiple Block Data Transfer (BDT) request pertransaction with the S7-200 CPU.

[0069] As part of power up initialization, the module can clear all datain the dual port RAM Banks 0 through 7. The fifty bytes of SM data areaallocated for the intelligent module are defined in Table 1 (thedefinition is given as if this were the first intelligent module in theI/O system). In order for the CUR_POS and CUR_SPEED values to beconsistent with one another the module H/W design can provide thefacilities to capture both values as an atomic operation. TABLE 1 DualPort RAM Bank Definition (Banks 8 through 15) SM Address DescriptionSMB200 To SMB215 Module name (16 ASCII characters) SMB200 is the firstcharacter. “EM253 Position”. SMB216 To SMB219 S/W revision number (4ASCII characters) SMB216 is the first character. SMB220 To SMB221 Errorcode (SMB220 is the MSB of the error code) 0000 - No error 0001 - Nouser power 0002 - Configuration block not present 0003 - Configurationblock pointer error 0004 - Size of configuration block exceeds availableV memory 0005 - Illegal configuration block format 0006 - Too manyprofiles specified 0007 - Illegal STP_RSP specification 0008 - IllegalLIM − specification 0009 - Illegal LIM + specification 000A - IllegalFILTER_TIME specification 000B - Illegal MEAS_SYS specification 000C -Illegal RP_CFG specification 000D - Illegal PLS/REV value 000E - IllegalUNITS/REV value 000F - Illegal RP_ZP_CNT value 0010 - IllegalJOG_INCREMENT value 0011 - Illegal MAX_SPEED value 0012 - Illegal SS_SPDvalue 0013 - Illegal RP_FAST value 0014 - Illegal RP_SLOW value 0015 -Illegal JOG_SPEED value 0016 - Illegal ACCEL_TIME value 0017 - IllegalDECEL_TIME value 0018 - Illegal JERK_TIME value 0019 - IllegalBKLSH_COMP value 0020 to FFFF - Reserved SMB222 Input/output status -reflects the status of the module inputs and outputs status

DIS - Disable output 0 = no current flow, 1 = current flow STP - Stopinput 0 = no current flow, 1 = current flow LMT− - Negative travel limitinput 0 = no current flow, 1 = current flow LMT+ - Positive travel limitinput 0 = no current flow, 1 = current flow RPS - Reference point switchinput 0 = no current flow, 1 = current flow ZP - Zero pulse input 0 = nocurrent flow, 1 = current flow

[0070] When an error condition or a change in status of the data isdetected, the module can indicate this by updating the SM locationscorresponding to the module's position. If it is the first module, itwill update SMB200 through SMB249 as required to report the errorcondition. If it is the second module, it will update SMB250 throughSMB299; and so on.

[0071] The module can implement Banks 15 through 127 for moduleinitiated communication to the PLC. There is no requirement for themodule to implement Banks 128 through 255

[0072] Module Configuration and Profile

[0073] Both the configuration and the profile information can be storedin a table in V memory in the PLC. The EM 253 Motion Module can accessits configuration and profile information using the pointer valuesupplied in the SM locations in the PLC.

[0074] The Configuration/Profile Table can be divided into threesections. The first section is the Configuration Block, which cancontain information used to set-up the module in preparation forexecuting motion commands. The second section is the Interactive Block,which can support direct setup of motion parameters by the user program.The third section can contain from 0 to 64 Profile Blocks, each of whichcan describe a predefined move operation that can be performed by themodule. Configuration Block Interactive Block Profile Blocks

[0075] Before the module can execute a profiled motion, it can performthe calculations to convert the general speed and position data providedin the profile block to the specific data and actions required toactually perform the move. These calculations can be performed wheneverthe module first sees the profile, but to improve responsiveness onsubsequent executions of the profile, the module can provide a cachememory to store the complete execution data for up to four profiles.When the user commands the execution of a given profile, the module cancheck the cache to see if the profile is resident. If the profile isresident in the cache, the profile can be executed immediately. If theprofile is not resident in the cache, the module can transfer theprofile from the PLC's V memory to cache before it is executed.

[0076] The profile cache can be implemented as a FIFO queue, orderedaccording to the time a profile was last executed. When the usercommands execution of a profile, that profile can become the newestentry, whether or not it previously existed in the cache. If the profileto be executed is not currently resident in the cache, then the residentprofile with the longest period of time since it was last executed canbe removed from the cache to make room for the newest profile. Anexample of cache behavior is shown in FIG. 4.

[0077] The module can manage the cache memory automatically without anyintervention required by the user. If the user changes profileinformation for profiles that have already been executed, the user canbe responsible for commanding a module reconfiguration. A moduleconfiguration command can cause the module to read the configurationinformation and empty the cache. If the user does not change any of theconfiguration information (only changes profile information), then themodule can empty the cache.

[0078] The cache is not necessarily used for motion controlled from theInteractive Block. When the command to execute a motion is issued, themodule can read the data contained within the Interactive Block toobtain the specifications of the move.

[0079] The following table defines the structure of theConfiguration/Profile Table which can be located in V memory of theS7-200 PLC. This information can be accessible by the module, buttypically can not be changed by the module. The Byte Offset column ofthe table can be the byte offset from the location pointed to by theconfiguration/profile area pointer.

[0080] The Type field for each entry can specify the numeric format ofall the double word values. If the MEAS_SYS configuration value is setto Pulses, a double integer value (int) can be used. If the MEAS_SYSconfiguration value is set to Engineering Units, a floating point value(fp) can be used.

[0081] The ranges given in Table 2 for speed and position values areexpressed in units of pulses per second and pulses, respectively. Whenusing engineering units, conversion to either pulses per second orpulses can be required to verify that the value is within the allowedrange. In absolute mode the position range is −231 to 231-1. However,each position change in an interactive move or each step of a profilemove can have a range of 1 to 230-1 pulses, with the exception that aposition change of 0 can be allowed for the initial step. For relativemode each position change in an interactive move or each step of aprofile move can have a range of 1 to 230-1 pulses. TABLE 2Configuration/Profile Table Byte Offset Name Function Description TypeConfiguration Block 0 MOD_ID Five ASCII characters that associate theconfiguration — with a module type; default value for the stepper moduleis M253A” 5 CB_LEN The length of the configuration block in bytes (1byte) — 6 IB_LEN The length of the interactive block in bytes (1 byte) —7 PF_LEN The length of a single profile in bytes (1 byte) — 8 STP_LENThe length of a single step in bytes (1 byte) — 9 STEPS The number ofsteps allowed per profile (1 byte) — 10 PROFILES Number of profiles from0 to 64 (1 byte) — 11 Reserved This location is reserved for use by thelibrary function. — It should be initialized to a value of 0x0000 by theconfiguration wizard (2 bytes) 13 IN_OUT_CFG Specifies the use of themodule inputs and outputs (1 byte) —

P/D - This bit selects the use of P0 and P1 Positive Polarity (POL = 0)0 - P0 pulses for positive rotation P1 pulses for negative rotation 1 -P0 pulses for rotation P1 controls rotation direction (0 - pos, 1 - neg)Negative Polarity (POL = 1) 0 - P0 pulses for negative rotation P1pulses for positive rotation 1 - P0 pulses for rotation P1 controlsrotation direction (0 - neg, 1 - pos) POL - This bit selects thepolarity convention for P0 and P1;(0 - positive polarity, 1 - negativepolarity) STP - Controls active level for stop input RPS - Controlsactive level for RPS input LMT− - Controls active level for negativetravel limit input LMT+ - Controls active level for positive travellimit input 0 - active high 1 - active low 14 STP_RSP Specifies thedrive's response to the STP input (1 byte) — Selection Description 0 Noaction, ignore input condition 1 Decelerate to a stop and indicate STPinput active 2 Terminate pulses and indicate STP input 3 to 255 Reserved(error if specified) 15 LMT−_RSP Specifies the drive's response to thenegative limit input — (1 byte) Selection Description 0 No action,ignore input condition 1 Decelerate to a stop and indicate limit reached2 Terminate pulses and indicate limit reached 3 to 255 Reserved (errorif specified) 16 LMT+_RSP Specifies the drive's response to the positivelimit input — (1 byte) Selection Description 0 No action, ignore inputcondition 1 Decelerate to a stop and indicate limit reached 2 Terminatepulses and indicate limit reached 3 to 255 Reserved (error if specified)17 FILTER_TIME Specifies the filter time for the STP, LMT−, LMT+, and —RPS inputs (1 byte)

Selection Filter Response Time ‘0000’ 200 μsec ‘0001’ 400 μsec ‘0010’800 μsec ‘0011’ 1600 μsec ‘0100’ 1600 μsec ‘0101’ 3200 μsec ‘0110’ 6400μsec ‘0111’ 12800 μsec ‘1000’ No filter ‘1001’ to ‘1111’ Reserved (errorif specified) 18 MEAS_SYS Specifies the measurement system used todescribe — moves (1 byte); 0 - pulses (speed measured in pulses/sec andposition values measured in pulses - values are double integer) 1 -engineering units (speed measured in units/sec and position valuesmeasured in units - values are single precision real) 2 to 255 -reserved (error if specified) 19 — Reserved - set to 0 (1 byte) — 20PLS/REV Specifies the number of pulses per revolution of the int motor,(only applicable when MEAS_SYS is set to 1) - (4 bytes) Range: 1 to 2³¹− 1 24 UNITS/REV Specifies the engineering units per revolution of thefp motor, (only applicable when MEAS_SYS is set to 1) - (4 bytes) Range:0.0 to 3.402823 × 10³⁸ 28 UNITS Reserved for Micro/WIN to store a customunits string — (4 bytes) 32 RP_CFG Specifies the reference point searchconfiguration (1 byte) —

RP_SEEK_DIR - This bit specifies the starting direction for a referencepoint search (0 - positive direction, 1 - negative direction)RP_APPR_DIR - This bit specifies the approach direction for terminatingthe reference point search (0 - positive direction, 1 - negativedirection) MODE - Specifies the reference point search method ‘0000’ -Reference point search disabled ‘0001’ - The reference point is wherethe RPS input goes active. ‘0010’ - The reference point is centeredwithin the ‘0011’ - The reference point is outside the active ‘0100’ -The reference point is within the active region of the RPS input. ‘0101’to ‘1111’ - Reserved (error if selected) 33 — Reserved - set to 0 — 34RP_ZP_CNT Number of pulses of the ZP input used to define the intreference point (4 bytes) Range: 1 to 2³¹ − 1 38 RP_FAST Reference pointseek speed - fast; (4 bytes) int/fp Range: MIN_SPEED to MAX_SPEED 42RP_SLOW Reference point seek speed - slow; maximum speed int/fp fromwhich the motor can instantly go to a stop or less (4 bytes) Range:MIN_SPEED to RP_FAST 46 SS_SPEED The starting speed is the maximum speedto which the int/fp motor can instantly go from a stop and the maximumspeed from which the motor can instantly go to a stop. Operation belowthis speed is allowed, but acceleration/deceleration times do not apply.(4 bytes) Range: MIN_SPEED to MAX_SPEED 50 MAX_SPEED Maximum operatingspeed of the motor (4 bytes) intlfp Range: 0 to 200K pps 54 JOG_SPEEDJog speed; (4 bytes) Range: MIN_SPEED to int/fp MAX_(—SPEED) 58 JOG_(—)The jog increment value is the distance (or number of int/fp INCREMENTpulses) to move in response to a single jog pulse. (4 bytes) Range: 1 to2³⁰ − 1 62 ACCEL_TIME Time required to accelerate from minimum tomaximum int speed in msec (4 bytes) Range: 20 ms to 32000 ms 66DECEL_TIME Time required to decelerate from maximum to minimum mt speedin msec (4 bytes) Range: 20 ms to 32000 ms 70 BKLSH_COMP The backlashcompensation value is the distance used to int/fp compensate for thesystem backlash on a direction change (4 bytes) Range: 0 to 2³⁰ − 1 74JERK_TIME Time during which jerk compensation is applied to the intbeginning and ending portions of an acceleration/deceleration curve(S-curve). Specifying a value of 0 disables jerk compensation. The jerktime is given in msec. (4 bytes) Range: 0 ms to 32000 ms InteractiveBlock 78 MOVE_CMD Selects the mode of operation (1 byte) — 0 - Absoluteposition 1 - Relative position 2 - Single-speed, continuous positiverotation 3 - Single-speed, continuous negative rotation 4 - Manual speedcontrol, positive rotation 5 - Manual speed control, negative rotation6 - Single-speed, continuous positive rotation with 7 - Single-speed,continuous negative rotation with 8 to 255 - Reserved (error ifspecified) 79 — Reserved - set to 0 (1 byte) — 80 TARGET_POS The targetposition to go to in this move (4 bytes) int/fp Range: See Note 1 84TARGET_(—) The target speed for this move (4 bytes) int/fp SPEED Range:MIN_SPEED to MAX_SPEED 88 RP_(—OFFSET) Absolute position of thereference point (4 bytes) int/fp Range: −2³¹ to 2³¹ − 1

[0082] Shown in Table 3, the Profile Block Section of theConfiguration/Profile Table can contain from 0 to 64 move profiles. Ifmore than 64 move profiles are needed, the user can bear the burden ofexchanging Configuration/Profile Tables, by changing the value stored inthe configuration/profile table pointer. TABLE 3 Byte PF Step Offset # #Name Function Description Type Profile Blocks 92 0 STEPS Number of stepsin this move sequence (1 byte) — (+0) 93 MODE Selects the mode ofoperation for this profile — (+1) block (1 byte) 0 - Absolute position1 - Relative position 2 - Single-speed, continuous positive rotation 3 -Single-speed, continuous negative rotation 4 - Reserved (error ifspecified) 5 - Reserved (error if specified) 6 - Single-speed,continuous positive rotation with triggered stop (RPS input signalsstop) 7 - Single-speed, continuous negative rotation with triggered stop(RPS input signals stop) 8 - Two-speed, continuous positive rotation(RPS selects speed) 9 - Two-speed, continuous negative rotation (RPSselects speed) 10 to 255 - Reserved (error if specified) 94 0 POSPosition to go to in move step 0 int/fp (+2) (4 bytes) Range: See Note 1above 98 SPEED The target speed for move step 0 int/fp (+6) (4 bytes)Range: MIN_SPEED to MAX_SPEED 102 1 POS Position to go to in move step 1int/fp (+10) (4 bytes) Range: See Note 1 above 106 SPEED The targetspeed for move step 1 int/fp (+14) (4 bytes) Range: MIN_SPEED toMAX_SPEED 110 2 POS Position to go to in move step 2 int/fp (+18) (4bytes) Range: See Note 1 above 114 SPEED The target speed for move step2 int/fp (+22) (4 bytes) Range: MIN_SPEED to MAX_SPEED 118 3 POSPosition to go to in move step 3 int/fp (+26) (4 bytes) Range: See Note1 above 122 SPEED The target speed for move step 3 int/fp (+30) (4bytes) Range: MIN_SPEED to MAX_SPEED 126 1 STEPS — (+34) 127 MODE —(+35) 128 1 POS int/fp (+36) 132 SPEED int/fp (+40)

[0083] Command Byte

[0084] The module can provide one byte of discrete outputs, which can beused as the command byte. The command byte can have the followingdefinition, in which R: 0=idle, 1=execute command specified incommand_code, as shown Table 4, below. TABLE 4

command_code: 000 0000 to 011 1111 Command 0-63, Execute motionspecified in Profile Blocks 0-63 100 0000 to 111 0101 Command 64-117,reserved (error if specified) 111 0110 Command 118, Activate the DISoutput 111 0111 Command 119, De-activate the DIS output 111 1000 Command120, Pulse the CLR output 111 1001 Command 121, Reload current position111 1010 Command 122, Execute motion specified in the Interactive Block111 1011 Command 123, Capture reference point offset 111 1100 Command124, Jog positive rotation 111 1101 Command 125, Jog negative rotation111 1110 Command 126, Seek to reference point position 111 1111 Command127, Reload configuration

[0085] An interrupt can be generated on each rising edge of the R bit asan indication that a new command for profile execution has beenreceived. Likewise, an interrupt can be generated on each falling edgeof the R bit indicating a transition to an idle condition. Modulefirmware can have the ability to disable this interrupt.

[0086] If the module detects a transition to idle (R bit changes stateto 0) while a command is active, then the operation in progress can beaborted and, if a motion is in progress, then a decelerated stop can beperformed. Once an operation has completed, the module can require atransition to idle before a new command will be accepted. If anoperation is aborted, then the module can complete any decelerationbefore a new command will be accepted. Any change in the command_codevalue while a command can be active can be ignored.

[0087] The motion module's response to a PLC mode change or faultcondition can be governed by the effect that the PLC exerts over thediscrete outputs according to the existing definition of the PLCfunction. Potential module reactions are described below:

[0088] (a) The PLC changes from STOP to RUN: The operation of the moduleis controlled by the user program.

[0089] (b) The PLC changes from RUN to STOP: The user can select thestate that the discrete outputs are to go to on a transition to STOP orthat the outputs are to retain their last state. Therefore, thefollowing possibilities exist:

[0090] 1. The R bit is turned OFF when going to STOP—any motion inprogress can be decelerated to a stop.

[0091] 2. The R bit is turned ON when going to STOP—if a motion was inprogress, it can be completed; if no motion was in progress, then theprofile specified by the ID bits can be executed.

[0092] 3. The R bit is held in its last state—any motion in progress canbe completed.

[0093] (c) The PLC detects a fatal error and turns OFF all discreteoutputs—any motion in progress can be decelerated to a stop; furthermovement can be prevented as long as the XA_OD signal remains active.

[0094] (d) The motion module can implement a watchdog timer that willturn the outputs OFF in the event that communication with the PLC islost. In the event that the output watchdog timer expires any motion inprogress can be decelerated to a stop.

[0095] (e) In the event that the motion module detects a fatal error inthe module's H/W or firmware, the P0, P1, DIS and CLR outputs can be setto the inactive state.

[0096] Command 0-63, Execute Motion Specified in Profile Block 0-63

[0097] Execution of this command can cause the module to perform themotion operation specified in the MODE field of the Profile Blockindicated by the command_code portion of the command. The specificationsfor Interactive Block motion operations typically are not cached, sothey can be read each time that the module receives this command.

[0098] In mode 0 (absolute position) the motion profile block can definefrom one to four steps with each step containing both the position (POS)and speed (SPEED) that describes the move segment. The POS specificationcan represent an absolute location, which is based on the locationdesignated as reference point. The direction of movement can bedetermined by the relationship between the current position and theposition of the first step in the profile. In a multi-step move areversal of direction of travel can be prohibited and can result in anerror condition being reported.

[0099] In mode 1 (relative position) the motion profile block can definefrom one to four steps with each step containing both the position (POS)and the speed (SPEED) that describes the move segment. The sign of theposition value (POS) can determine the direction of the movement. In amulti-step move, a reversal of direction of travel can be prohibited andcan result in the reporting of an error condition.

[0100] In the single-speed, continuous speed modes (2 and 3), theposition (POS) specification can be ignored and the module canaccelerate to the speed specified in the SPEED field of the first step.Mode 2 can be used for positive rotation and mode 3 can be used fornegative rotation.

[0101] In the single-speed, continuous speed modes with triggered stop(6 and 7) and RPS inactive, the module can accelerate to the speedspecified in the SPEED field of the first step. If and when the RPSinput becomes active, movement can stop after completing the distancespecified in the POS field of the first step. If the POS=0, then themovement can decelerate to a stop without regard to the distancetraveled. Mode 6 can be used for positive rotation and mode 7 can beused for negative rotation.

[0102] In modes 8 and 9, the binary value of the RPS input can selectone of two continuous speed values as specified by the first two stepsin the profile block. Mode 8 can be used for positive rotation and mode9 can be used for negative rotation. The SPEED can control the speed ofmovement. The POS values can be ignored in this mode. The followingtable defines the relationship between the inputs and the step withinthe profile block. RPS Description No current flow Step 0 controls thespeed of the drive Current flow Step 1 controls the speed of the drive

[0103] Command 118, Activate the DIS Output

[0104] Execution of this command can result in the activation of the DISoutput.

[0105] Command 119, De-activate the DIS Output

[0106] Execution of this command can result in the de-activation of theDIS output.

[0107] Command 120, Pulse the CLR Output

[0108] Execution of this command can result in the issuance of a 50 mspulse on the CLR output.

[0109] Command 121, Reload Current Position

[0110] Execution of this command can cause the module to read the valuefound in the TARGET_POS field of the Interactive Block and set thecurrent position to that value.

[0111] Command 122, Execute Motion Specified in the Interactive Block

[0112] Execution of this command can cause the module to perform themotion operation specified in the MOVE_CMD field of the InteractiveBlock. The specifications for Interactive Block motion operationstypically are not cached, so they can be read each time that the modulereceives this command.

[0113] In the absolute and relative motion modes (0 and 1), a singlestep motion can be performed based upon the target speed and positioninformation provided in the TARGET_SPEED and TARGET_POS fields of theInteractive Block.

[0114] In the single-speed, continuous speed modes (2 and 3), theposition specification can be ignored and the module can accelerate tothe speed specified in the TARGET_SPEED field of the Interactive Block.

[0115] In the manual speed control modes (4 and 5), the positionspecification can be ignored and the user program can load the value ofspeed changes into the TARGET_SPEED field of the Interactive Block. Themotion module can continuously monitor this location and respondappropriately when the speed value changes.

[0116] In the single-speed, continuous speed modes with triggered stop(6 and 7) and RPS inactive, the module can accelerate to the speedspecified in the SPEED field of the first step. If and when the RPSinput becomes active, movement can stop after completing the distancespecified in the POS field of the first step. If the POS=0, then themovement can decelerate to a stop without regard to the distancetraveled. Mode 6 can be used for positive rotation and mode 7 can beused for negative rotation.

[0117] Command 123, Capture Reference Point Offset

[0118] Execution of this command can allow for the establishment of thezero position that is at a different location from the reference pointposition.

[0119] Before this command is issued, the reference point position canbe determined and the user can jog the machine to the work startingposition. Upon receiving this command, the module can compute the offsetbetween the work starting position (the current position) and thereference point position and write that computed offset to the RP_OFFSETfield of the Interactive Block. Then, the current position can be set to0. This can establish the work starting position as the zero position.

[0120] In the event that the stepper motor loses track of its position(power is lost, the stepper motor is repositioned manually, etc.) theSeek to Reference Point Position command can be issued to re-establishthe zero position automatically.

[0121] Command 124, Jog Positive Rotation

[0122] This command can allow the user to manually issue pulses formoving the stepper motor in the positive direction.

[0123] If the command remains active for less than 0.5 seconds, themotion module can issue the number of pulses specified in JOG_INCREMENTwhile accelerating to the JOG_SPEED. If the command remains active for0.5 seconds or longer, the motion module can begin to accelerate to thespecified JOG_SPEED. Once a transition to idle is detected, the modulecan decelerate to a stop.

[0124] Command 125, Jog Negative Rotation

[0125] This command can allow the user to manually issue pulses formoving the stepper motor in the negative direction.

[0126] If the command remains active for less than 0.5 seconds, themotion module can issue the number of pulses specified in JOG_INCREMENTwhile accelerating to the JOG_SPEED. If the command remains active for0.5 seconds or longer, the motion module can begin to accelerate to thespecified JOG_SPEED. Once a transition to idle is detected, the modulecan decelerate to a stop.

[0127] Command 126, Seek to Reference Point Position

[0128] Execution of this command can initiate a reference point seekoperation using the specified search method. When the reference pointhas been located and motion has stopped, then the module can load thevalue read from the RP_OFFSET field of the Interactive Block into thecurrent position.

[0129] Command 127, Reload Configuration

[0130] Execution of this command can cause the module to read theconfiguration/profile table pointer from the appropriate location in SMmemory. The module then can read the Configuration Block from thelocation specified by the configuration/profile table pointer. Themodule can compare the configuration data just obtained against theexisting module configuration and perform any required setup changes orrecalculations. Any cached profiles can be discarded.

[0131] Reference Point Definition

[0132] The location known as the reference point can have one of severalpre-defined sequences of module input conditions. The user can selectthe definition of the reference point that most closely matches theneeds of the application. Once the user has selected a definition forthe reference point and configured the module accordingly, the user canissue the seek reference point command. In response to this command, themodule can automatically seek the reference point position, stop at thereference point and activate the CLR output for a period of 50 msec.

[0133] Potential definitions of the reference point that the user canchoose from are listed below (the number of options are multiplied byfour when all combinations of the RP_SEEK_DIR and RP_APPR_DIRspecifications are included):

[0134] a) Mode 1: The reference point can be where the RPS input goesactive on the approach from the work zone side.

[0135] b) Mode 2: The reference point can be centered within the activeregion of the RPS input.

[0136] c) Mode 3: The reference point can be located outside the activeregion of the RPS input. RP_Z_CNT can specify how many zero pulse countson the ZP input to move after the RPS input goes inactive.

[0137] d) Mode 4: The reference point can be most likely located withinthe active region of the RPS input. RP_Z_CNT can specify how many zeropulse counts on the ZP input to move after the RPS input goes active.

[0138] FIGS. 5-8 are reference point seek diagrams for Modes 1-4,respectively. These reference point seek diagrams illustrate thedefinition of the reference point and the sequence of finding thereference point.

[0139] For FIGS. 5-8, the work zones have been located so that movingfrom the reference point to the work zone requires movement in the samedirection as the RP Approach Direction. By selecting the location of thework zone in this way all the backlash of the mechanical gearing systemcan be removed for the first move to the work zone after a referencepoint seek.

[0140]FIG. 9 includes two reference point seek diagrams, the uppershowing the work zone in relationship to the RPS and LIM+ switches foran approach direction that can eliminate the backlash. The lower diagramplaces the work zone so that the backlash is not necessarily eliminated.A similar placement of the work zone is possible, although notrecommended, for each of the possible search sequences in each of Modes1-4.

[0141] User Interface

[0142] Table 5 shows the inputs, outputs and status LED's for themodule. TABLE 5 Local I/O LED Color Function Description — MF Red Themodule fault LED shall be illumi- nated when the module detects a fatalerror — MG Green The module good LED shall be illumi- nated when thereis no module fault and shall flash at a 1 Hz rate when a configurationerror is detected — PWR Green The user power LED shall be illumi- natedwhen 24 VDC is supplied on the L+ and M terminals of the module InputSTP Green Illuminated when there is current flow in the stop inputcircuit Input RPS Green Illuminated when there is current flow in thereference point switch input circuit Input ZP Green Illuminated whenthere is current flow in the zero pulse input circuit Input LMT− GreenIlluminated when there is current flow in the negative limit inputcircuit Input LMT+ Green Illuminated when there is current flow in thepositive limit input circuit Output P0 Green Illuminated when the P0output is pulsing Output P1 Green Illuminated when the P1 output ispulsing or indicating direction. (see the description of the IN_OUT_CFGfield in the Configuration/Profile Table) Output DIS Green Illuminatedwhen the DIS output is active Output CLR Green Illuminated when theclear deviation counter output is active

[0143]FIG. 10 is a block diagram showing an exemplary arrangement andlabeling of LED's of an exemplary motion module of the presentinvention. FIG. 11 is a circuit diagram showing exemplary circuits forinputs and outputs and the associated user power terminals of anexemplary motion module of the present invention. This figure is aschematic representation and does not reflect the order of the terminalblock screws.

[0144] The module's specification for the inputs and outputs are shownin Table 6. The operation of open drain outputs above 5VDC mightincrease radio frequency emissions above permissible limits. Radiofrequency containment measures might be required for certain systems orwiring. Depending on the pulse receiver and cable, an additionalexternal pull up resistor might improve pulse signal quality and noiseimmunity. TABLE 6 Description Specification Power Supply Input SupplyVoltage 11-30 VDC Input Supply Current (5 VDC ± 10%) Load Current 12 VDCInput 24 VDC Input 0 mA (no load) 120 mA, max 70 mA, Max 200 mA (ratedload) 300 mA, max 130 mA, max current limit (0.5 to 1.5 A) 700 mA, max350 mA, max Isolation Tested Value 500 VAC for 1 minute (Input Power toLogic) (Input Power to Inputs) Reverse Polarity: on L+ input power andon +5 VDC output power Input Voltage Maximum Continuous Permissible STP,RPS, LMT+, LMT− 30 VDC ZP 30 VDC at 20 mA, maximum Surge 35 VDC for 0.5sec Rated Value STP, RPS, LMT+, LMT− 24 VDC at 4 mA, nominal ZP 24 VDCat 15 mA, nominal Logic “1” signal (minimum) STP, RPS, LMT+, LMT− 15 VDCat 2.5 mA, minimum ZP 3 VDC at 8.0 mA, minimum Logic “0” signal(maximum) STP, RPS, LMT+, LMT− 5 VDC at 1 mA, maximum ZP 1 VDC at 1 mAmaximum Input Delay Times STP, RPS, LMT+, LMT− 0.2 to 12.8 msec, userselectable ZP 2 μsec minimum

[0145]FIG. 12 is a pulse out generation block diagram for an exemplaryembodiment of the motion module. Table 7 provides functionaldescriptions for various components of the motion module block diagramof FIG. 12. TABLE 7 Mnemonic Description CPU access m spec pulse widthspecification, number of clocks per pulse. written via 15 bits + sign,sign bit set is an error pipeline read back provided m spec lsb 16 bitless significant bit extension of pulse width specification, accumulatesnot accessible fractional delta width changes dm spec 32 bit signed,fixed point delta m (delta pulse width) specification written viapipeline m cntr pulse width counter, loaded with m spec, counts downthrough 0 not accessible { (m + 1) clocks per pulse } m hi cntr loadedwith right shift value of m spec, counts down through 0 not accessiblepulse out is high when any bit is 1 (negligible asymmetry). pulsecounter ( Counts on leading edge of each pulse, from loaded value downto 0. pc) (n loaded to pc results in n pulses executed.) not accessiblepulse count Value loaded to pulse count down counter, loaded frompipeline spec bits 31:30 of pulse count spec, in combination with RUNcommand, select last (pc spec) step and continuous run modes written viapipeline pc[31:30] spec and pipeline copies write via spec copyspecifies current operation as: pipeline 00 - do nothing/STOP run mode01 - run by steps, pc counts down to 0, then loads new dm and pc frompipeline 10 - run continuous, pc counts down . . . may roll over 11 -last step, pc counts down to 0, then stops After any stop, re-startrequires the state machine must be brought to idle state by a STOPcommand, then a load of the pc and a xfr_pipeline to set up for nextmove. pc pipeline Value loaded to pc spec when pulse count = 0 or onxfr_pipeline. Initiating a write only run_steps operation with a pulsecount specification of 0 is an error. dm pipeline value loaded to dmspec when pulse count compares to spec or on xfr_pipeline write only mspec pipeline value loaded to m spec when pulse count = 0 or onxfr_pipeline. Typically run write only time changes in pulse width areaccomplished with the delta pulse width mechanism rather than directloads of m pipeline. pipeline refresh Records for m, dm, pc pipelinevalues if new value available for load. Set for not accessible eachregister on write to lsb. NO values are transferred unless the pc lsbhas been written. xfr pipeline Decode address on write only - forcesload of dm, pc, and m pipelines to < no data > working registers if thepipelines have been updated. Used to set up working register + pipelineregister for start up, or to escape from run continuous mode. Also usedto escape from m overflow condition by forcing pipeline load to m, dm,and pc as required. Synchronized internally to be effective aftercurrent pulse completes. pc read buf Pulse count read buffer. read onlym read buf copied from m_spec after each update. locked by msb read,released by lsb read only read. trip counter lsb probably not needed . .. divides down pulse count to rate that CPU ASIC can read only count ifnot 200 KHz (need to investigate) Reset state of Address assignments allregisters is 0:3 command/status registers 0. 4:7 dm_pipe 8:B pc_pipe C:Dm_pipe E:F unused 10 xfr_pipeline 11 interrupt ack address 12 rpsattributes 13:1B reserved 1C:1D m_spec read buffer 1E:1F m_spec readbuffer overmap -- 28:2B pc_actual read buffer (deleted) command bit Bits0,1 are commands written from uP, read back as written, not changed bymachine. Bits 2 . . . 5 reflect machine response. See sequencedescriptions below. register 7 Unused read/write, 6 RPS, after filter, 1= current flow at input point changed by 5 1 = accel_bar, actionfreezing pulse width, barring acceleration or deceleration both CPU and4 1 = active_pulse, indicates pulses are in progress starts with actualleading edge of 1^(st) pulse persists until low time of last pulse iscomplete FPGA 3 1 = abort_ack Abort command processed, pipeline rupt andaccel_bar valid. Exit from run_steps has been completed, exit fromrun_continuous is blocked. address C00 2 1 = run_ack, transition to runstate acknowledged by machine 1^(st) pulse of current sequence iscommitted cleared during last pulse in finish or estop states 1 1 =abort_cmd, abort command from uP . Exit to abort state, thence torun_continuous if in run_steps. Block exit from run_continuous untilcleared. 0 1 = run_cmd, run command from uP 0 = stop command from uP rpsattribute bit register 7:5 RPS filter: 0 = 2 us, 1 = 200 us, 2 = 400 us,3 = 800 us, 4 = 1.6 ms 5 = 3.2 ms, 6 = 6.4 ms, 7 = 12.8 ms (physicaldelay of input point will add several microseconds) read/write 4RPS_falling_edge: 1 = xfr_pipeline on rps falling edge address C12 3RPS_rising_edge: 1 = xfr_pipeline on rps rising edge 2 RPS pulse catch:1 = capture next change in RPS. Allow no further changes in RPS_filt touP until this bit is cleared. 1 Spare 0 Spare direction bit attribute7:3 spare register 2 clock source: 0 = sys clk 1 = external clock (CPUPCLK) read/write 1 dir mode: 0 = output 0 pulse for up, output 1 pulsefor down 1 = output 0 pulsing, output 1 = 1 for up address C01 0 dir: 0= count up bits [2:0] should 1 = count down not be changed duringoperation Interrupt/ bit FPGA svc_rqst interrupt = OR of all bits inthis register that are selected (=1) by the interrupt mask register.Latched edge bits are cleared by write of 1 to the corresponding bits inthe interrupt ack register. Status level bits must be cleared byappropriate corrective action. Changes in the mask do not change theprior state of latched edge bits, but will mask/unmask levels. statusregister 7 pc underflow: Pulse down counter received a pulse while atzero value. CPU can note pc underflow and record if interested. Latchededge. This will happen routinely, for example, for a run stepstransition to run continuous. read only 6 m overflow/underflow: 1 =illegal result (negative number) occurred on attempt to apply dm to m.Refuse to load illegal value to m_spec, continue running constant m,last legal value. Status level. Requires change in m or dm pipe valuesand xfr_pipeline to load corrective m or dm from pipeline. address C02 5pipeline starved: A transfer pipeline was requested (by a counted-pulserun step complete, an rps edge, or a commanded xfr) without a refreshedpc indicating a completed pipeline load. Block pipeline loads, continuerunning with last value. Latched edge. Note that clearing this bitclears the interrupt but does not alter the basic run time statemachine, which is stuck on a run_step that will never complete. Recoveryrequires an abort command to escape from run_steps mode and axfr_pipeline to load m, dm, and pc values as needed to start recoverystep. Interrupt 4 RPS falling edge: 1 = an RPS falling edge hasoccurred, and has not been cleared by a write to the interrupt clearregister. Latched edge. mask register 3 RPS rising edge: 1 = an RPSrising edge has occurred, and has not been cleared by a write to theinterrupt clear register. Latched edge. read/write 2 Qx.7 falling edge:1 = falling edge on Qx.7 in the dual port RAM since the last clear ofthis bit by a write to the interrupt clear register. Latched edge. (QBx= Page 0, R 12 from bus or DP-RAM address 4 in Slave space) address C031 Qx.7 rising edge: 1 = rising edge on Qx.7 in the dual port RAM sinceInterrupt Ack the last clear of this bit by a write to the interruptclear register. Latched Write only edge. Address C11 (QBx = Page 0, R12from bus or DP-RAM address 4 in Slave space) 0 pipeline empty: 1 = thereare no registers currently refreshed and available for pipelinetransfer. Note this bit = 0 if ANY pipeline register is refreshed.Refresh is posted on lsb write. Status level. Q refresh 7 Bit 7 is seton any write to Q from slave interface. Bit 7 is cleared by any detectwrite from the local processor. Note that the Qx.7 rising edge/fallingC13 edge interrupt action can be determined by the state of a Qx.7 flipflop in the em bus slave hardware, not by the value of the bit in thedual port RAM. Writes to Qx from the uP bus might result in apparentlyinconsistent operation.

[0146] State Diagram

[0147] A state diagram for the motion module can include the followingvariables:

[0148] run_q: qualified run command, command register content changesare recognized at chosen safe times—generally in sub-states below thetop level diagram.

[0149] X0=stop

[0150] 01=run

[0151] 11=abort

[0152] modes from pc(31:30)

[0153] run_steps, last_step, run_cont (continuous), mode_stop

[0154] xfr_pipeline : command to load refreshed pipe values to workingregisters, commanded by CPU or RPS edge.

[0155] run_cld : run instruction to pulse generator state machine.

[0156] X0=stop

[0157] 01=run

[0158] 11=abort

[0159] pc_capture_time: a timing strobe, name comes from original use toidentify when pulse counter contents are stable for read/capture. Nowused only for state transition timing.

[0160] States:

[0161] idle: do nothing, exit on xfr_pipeline command to init_load

[0162] init_load: move initial pipeline values to working registers,wait for run command to transition.

[0163] return to idle if stop command or mode_stop

[0164] go to run_a_step to start a stepped profile

[0165] go to run_continuous for steady speed operation

[0166] run_a_step: enable pulse machine, set run_ack, periodicallyexamine pulse count & run command, exit on:

[0167] if run command=stop, exit to estop

[0168] if run command=abort, exit to abort

[0169] when pulse count=0, exit to pipe_load or finish as chosen byrun_steps or

[0170] last_step

[0171] pipe_load: load refreshed pipe values to working registers,examine new pc[31:30] to determine next state:

[0172] return to run_a_step to continue a stepped profile

[0173] go to run_continuous for steady speed operation

[0174] go directly to finish

[0175] if pc not refreshed, clear all pipe refresh flags and return tosource state

[0176] run_continuous: enable pulse machine, acknowledge run or abortcommand, periodically examine run command and xfr_pipeline.

[0177] on xfr_pipeline go to pipe_load for new information

[0178] if run command=stop, exit to estop

[0179] abort: instruct pulse machine to freeze pulse width, go torun_continuous

[0180] estop: disable pulse machine ability to start new pulses, clearrun_ack, exit to idle on pulse complete.

[0181] finish: disable pulse machine ability to start new pulses, clearrun_ack, exit to idle on pulse complete and run command=stop.

[0182] Certain potential operating sequences for the pulse generatormodule are shown in Table 8, below. TABLE 8 Processor FPGA NORMALSTEPPED RUN SEQUENCE pc_spec[31:30] = run by steps Start from reset ---all command registers cleared. Pipeline and spec data registers unknown.(Some may be RAM, not easily initialized.) Write attribute register withdirection Sets pulse up/down and direction on selections. pulse_out[1:0]Write m, dm, pc pipelines. Note pipeline refresh per each value lsb.Write xx to xfr_pipeline address. Transfer pipeline values for writtenregisters to spec registers. Clear pc. Write dm, pc pipeline. Notepipeline refresh on lsb write of each value. Write run_cmd <= 1 loadm_spec to pulse width counter start pulse out, set run_ack bit duringeach pulse, m_spec <= m + dm at end of each pulse pc = 1, m_cntr <=m_spec when pc= 0, load fresh values from pipeline (will not load unlessnew value in pipe) clear pipeline refresh flags set pipeline emptyinterrupt Write dm, pc pipeline. Note pipeline refresh on lsb write ofeach value. Write to rupt_ack address Clear interrupt. CPU can checkstatus by reading Continue pulse out and pipeline loads as run_ack = 1to indicate started above until pc[31:30] in spec register indicateactive_pulse = 1 to indicate still running last step. error register(see below) when last step and pc = pc_spec m_spec (pulse width) run_ack<= 0 pc (pulse count) stop pulse out msb read latches consistentword/long value do not clear pc active_pulse <= 0 when last pulsecomplete write run_cmd <= 0 return to idle state, ready to start newsequence Stepped Run ABORT Write abort cmd <= 1 ABORT recognized on nextpulse rising edge. All pipeline loads inhibited. New pipeline requestinterrupt inhibited. pulse width changes inhibited, on following fallingedge, dm_bar <= 1. On second pulse rising edge, abort_ack <= 1 toindicate transition complete. (note this could violate S curve 2^(nd)derivative limits, but less severe than derivative sign reversal) Readsm_spec, checks status of pipeline request interrupt, infers dm_specloads corrective action dm, pc, etc clear ABORT bit to re-enablexfr_pipeline on next pulse writes xx to xfr_pipeline address transfersnew pipeline data to spec registers continues running in normal RUNstate CONTINUOUS RUN SEQUENCE cpu has loaded pc_spec[31:30] = In RUNmode already, run continuous to pipeline after accelerating in pipelinerequest interrupt asserted. a stepped run sequence. Runs pulses perpipelined specs for m, dm. pc counts up continuously, with no pipelineloads. pc overflow posts error bit and interrupt to allow CPU to countroll-overs. writes next values of m, dm, etc. notes refreshed pipelinevalues write xx to rupt_ack address clears pipeline request interruptcontinues to run per m, dm specs. pc continues to count up. No furtherpipeline loads or rupts . write xx to xfr_pipeline address On nextpulse, xfr refreshed pipeline values. Run per new values m, dm, pc, etcMonitor status, change speed (m) etc on the Responds to xfr pipelinecommands, fly by loading pipeline and xfr_pipeline otherwise runs withno change. commands. Based on whatever criteria, decides to startdeceleration. Write dm, pc pipelines with values for first step ofdeceleration to come. pc[31:30] in pipeline will typically = run bysteps write xx to xfr_pipeline address On next pulse, xfr refreshedpipeline values. Run per new values m, dm, pc, etc, including newpc[31:30] which typically will change mode back to run by steps. E-STOPWrite command register to STOP. Current pulse completes. Then pulsestops. CPU can check status per above. pc and m_spec not changed.

[0183] For certain motion modules, potential CPU ASIC pin assignmentsand address mapping are provided in Table 9, below: TABLE 9 CPU PinFunction Motion Module Usage Non-Volatile CS Up to 256 KB Flash or OTP.42096 bytes of this storage will be required to load the FPGA program.RAM CS 32 KB RAM Free Chip Select Motion FPGA 0:3FF + 800 = 800:BFFIntelligent Module DP RAM C00:C1 D Motion Register Space 0:3command/status registers 0: command register 1: direction attributesregister 2: interrupt/status register 3: interrupt mask register 4:7dm_pipe 8:B pc_pipe C:D m_pipe E:F m_pipe overmap 10 xfr_pipeline(command on write) 11 interrupt ack (ack per bit in write byte) 12 rpsattributes register 13 q refresh detector 14:1B reserved for additionalreadbacks 1C:1D m_spec read buffer 1E:1F m_spec read buffer overmap28:2B pc_actual read buffer (deleted) 10.0 E-Stop (all inputs = 1 forpower flow in input point) 10.1 Limit+ 10.2 Limit− 10.3 Pulse up orpulse, input into High speed counter (4) of pulse events 10.4 Pulse downor direction, input into High speed counter (4)of pulse events. 1 =count up in pulse & direction mode. 10.5 User power OK 10.6 Pulse up orpulse: input to a High speed counter (1) of pulse events. 10.7 Pulsedown or direction: input to a High speed counter(1) of pulse events.11.0 (pulled up for no action) 11.1 RPS: gates high speed counter (1)for counting pulse out during RPS 11.2 Z-pulse/High speed counter (2)Z-pulse counter 11.3 FPGA Init. 1 = FPGA Configuration reset in progressor configuration error. Use pulse catch or handshake with Q1.1 to verifythat a configuration reset occurred in response to Q1.1 toggle. 11.4(pulled up for no action) 11.5 RPS: gates High speed counter (2) forcounting Z pulse during RPS Q0.0, Q0.1 Spare Q0.2 User driven motordisable (1 = current flow in sinking output) Q0.3 Deviation counterclear (1 = current flow in sinking output) Q0.4 Module Good LED, 1 = LEDON Q0.5 spare Q0.6 Slave Enable, 1 = bus response enabled Q0.7 MotionReset, 0 = Reset motion registers, counters, etc. Q1.0 ConfigurationEnable: 1 => write cycles to non-volatile chip select space load FPGAconfiguration data to FPGA. Load is sequential, 1 write per byte, forfull 42096 bytes. (Other cycles may intervene, but each write to FPGAspace increments internal address pointer). Motion module CPU reset =200 ms max from power up. Spec delay from “power up” to Slave ready: 500ms. Master cpu reset = 140 ms min. Time available for load = 140 + 500 −200 = 440 ms. Estimated 86 ms required. Q1.1 Configuration Reset: 0 =>Reset FPGA Configuration. Clears all FPGA configuration RAM, initializesRAM address pointer. Sense is chosen so that watchdog timeout clearsFPGA. Power Fail Pending EM Bus Out Disable Watch Dog In 555 timeroscillator, clock time ˜944 uS, range 600-1300 us. INT4 Motion servicerequest RXD/TXD On jumper stakes for flash download communication. PCLKAlternate time base to motion pulse width counter for low speedoperation. It is not intended that the time base be changed from 33 MHzto PCLK, or for PCLK to change in frequency, during pulses.

[0184] Pulse Calculations

[0185] A number of motion scenarios can be visualized. One scenario ofparticular difficulty emerges when the distance an actuator is to travelis short and insufficient to achieve maximum speed. For this scenario,at least three cases can be recognized.

[0186] Generally, a linear slope can be defined by F_start, F_end (F0),and t_a (the acceleration time), such that

[0187] the slope a=(F_end−F_start)/t_a.

[0188] Also, n_end=number of pulses from F_start to F_end.

[0189] In the case of an S-curve:

[0190] t_j=jerk time, a_max=(F_end−F_start)/t_a,

[0191] k=da/dt_max=a_max/t_j

[0192] The user can specify an n_target (n_(t)) that corresponds to thedesired motion distance.

[0193] Case 1: Linear Acceleration, Acceleration=Deceleration

[0194]FIG. 13 is a graph of frequency versus time for an exemplaryembodiment of the present invention, showing this case. The problem caseis identified by n_target<2*n_end.

[0195] Solution:

[0196] Choose way point n₁ just less than n_(t)/2, with associated F₁.

[0197] Profile consists of acceleration F_end to F₁, deceleration fromF₁ to F_end, with

[0198] an intermediate constant speed step of n_cs pulses,n_cs=n_(t)−2*n₁.

[0199] Case 2: Linear Acceleration, Acceleration a1 not Equal toDeceleration a2.

[0200]FIG. 14 is a graph of frequency versus time for an exemplaryembodiment of the present invention, showing this case. For decelerationslope: F_end is still the high frequency, n is counted up from lowspeed, just as if it was an acceleration slope. Problem case isidentified by n_target<n_end_(—)1+n_end_(—)2.

n ₁=½a ₁ t ₁ ² +F ₀ t ₁ ; n ₂=½a ₂ t ₂ ² +F ₀ t ₂ ; t ₂=(a ₁ /a ₂)t₁

[0201] For very short moves, F₀*t might be an appreciable part of thetotal move.

n _(t) =F ₀(t ₁ +t ₂)+½a ₁ t ₁ ²+½a ₂ t ₂ ², or

a ₁/2(1+a ₁ /a ₂)t ₁ ²+(1+a ₁ /a ₂)F ₀ t ₁ −n _(t)=0

a ₁/2t ₁ ² +F ₀ t ₁ −n _(t)/(1+a ₁ /a ₂)=0

t ₁ =−F ₀ /a ₁+sqrt{F ₀ ² /a ₁ ²+2n _(t)/(a ₁(1+a ₁ /a ₂))}

[0202] For realizable motions there is always a positive number underthe radical and the realizable root is always found by adding a positivesquare root to the initial term.

[0203] Use the above expression to compute t₁. Now, finding n₁=½a₁t₁²+F₀t₁, choose way point just less than n₁ on the acceleration slope,with associated speed F₁. Interpolate as required on the decelerationslope to match speed between acceleration and deceleration slopes,finding an n₂ on the decel slope. As before, find the length of aconstant speed step that links the two slopes, n_cs=n_(t−n) ₁−n₂. Thetotal move is accelerate for n₁ steps, a (short) constant speed stepn_cs, decelerate for n₂ steps.

[0204] Case 3: Short S-curve—distance n not sufficient to completeS-curve to max speed

[0205]FIG. 15 is an S-curve graph of frequency versus time for anexemplary embodiment of the present invention, showing this case.

[0206] For the case of a short S-curve: t_(j)=jerktime,a_(max)=(F_end−F_start)/t_a, k=da/dt_max=a_(max)/t_(j)

[0207] In the initial curve region:

[0208] a=k t

[0209] F=F₀+½k t²

[0210] F change with jerk time t_(j): F_(j)=½k t_(j) ²

[0211] For the S-curve, recall there is an F_(j) associated with jerktime, t_(J), and that the change in F during the curve region issymmetrical during the increasing and decreasing acceleration portionsof the curve.

[0212] One procedure is to solve for the simple trapezoid as before,identifying a maximum speed F₁ reached at count n₁ and time t₁. Then,reduce the maximum frequency to a new F_(max) which can be achieved inthe same accel/decel time t₁. The n_cs (constant speed region) now getsenlarged a bit from the simple trapezoid case, such that:n_cs=n_(t)−2*n(F_(max)).

[0213] If t1>=2 tj: There is a linear region+2 full jerk times. ObtainF_(max)=F₀+2*F_(j)+(t₁−2t_(j))*a_(max). Apply standard S curvecalculation to F_(max) to get n vs. v up to F_(max). Then the constantspeed distance is n_cs=n_(t)−2 * n(f_(max))

[0214] If t₁<2 t_(j): There will be a pure S-curve with an inflectionpoint at t₁/2. The ΔF around the inflection point: F_(inflection)=½k(t₁/2)², and F_(max)=F₀+2*F_(inflection)=F₀+k(t₁/2)². Apply the standardS curve to F_(max) and find n_cs as before.

[0215] What follows is an exemplary pseudo-code subroutine listing fordetermining a plurality of target frequencies, pulse widths,differential pulse widths, and pulse counts, for a portion of a motioncontrol profile, that portion being a single change in frequencyaccording to a specified beginning frequency, ending frequency, maximumacceleration, and maximum change in acceleration(that is, an S-curvecase) such as that described above. The target frequencies aredistributed semi-logarithmically, with constraints to achieve realizableminimum time intervals, and maximum time intervals consistent with adesired level of accuracy in representation of the upper frequencyportion of the S curve. All data input and output has been removed toclarify the algorithm.

[0216] Rem: S-curve version

[0217] Rem: Generate table of target pulse counts and pulse widths withinterpolation factor

[0218] Rem: divide up the ramp into steps (way points) of equalpercentage changes in F

[0219] Rem: for each step, find the target F, pulse width, pulse count,and change in pulse width

[0220] Rem: per pulse needed to get there while staying on the slope

[0221] Rem:

[0222] Rem: limit change in acceleration per Jerk Timespec—da_dt=a_max/Jerk_time

[0223] Rem: keep a working buffer of steps, selectively plot points

[0224] Rem: so that a complete slope can be recorded

[0225] Rem: use f_end/f_start ratio to set target steps size

[0226] Rem: 1.15{circumflex over ( )}32 ˜100; 1.1{circumflex over ( )}32˜20; 1.1{circumflex over ( )}48 ˜100

[0227] Rem: e.g., for a 5% start speed (1/20), 32 steps will give ˜10%dF/F

[0228] Rem: initial dF/F/step=exp (log (fmax/fmin)/max_steps)

[0229] Rem: if step<1 ms set step time to 1 ms

[0230] Rem: if step<1 pulse set step time to 1 pulse

[0231] Rem: when F appreciable, set dF/F to a moderate mid-range value

[0232] Rem: then go to tighter spacing of steps in upper jerk range

[0233] Rem: m=clocks/pulse, n=pulse count at each step, dn=delta n perstep

[0234] Dim m(100) As Long

[0235] Dim n(100), dn As Long

[0236] Rem: a step is a pre-calculated way point, controlling multiplepulses

[0237] Dim step As Integer, pulse As Long

[0238] Rem: m_sum records actual elapsed time in clocks by adding m'sfor each pulse

[0239] Rem: m_fix: shifted fixed point that accumulates fractionalchanges in pulse width

[0240] Dim m_sum(100), m_fix As Long

[0241] Rem: fixed point shift is decimal for ease of de-bug, will bebinary factor (e.g., 1024) in use

[0242] Dim fix_shift As Long

[0243] fix_shift=1000

[0244] Rem: elapsed time to beginning of step, time/step, jerk time

[0245] Dim t(100), dt, t_j As Double

[0246] Rem: dm is shifted fixed point fractional change in pulsewidth/pulse

[0247] Dim dm(100) As Long

[0248] Rem: frequency at step, jerk frequency associated with jerk time,derivative of a

[0249] Dim f(100), f_j, da_dt As Double

[0250] Dim i, j, k, clear_row As IntegerRem: misc indices

[0251] Dim m_dt, m_bar As Double

[0252] Rem: input parameters: acceleration time, frequencies

[0253] Dim t_a, F_start, F_end, F_clock As Double

[0254] Rem: dF/F factor to compute equal percentage steps

[0255] Dim dF_factor As Double

[0256] Dim max_steps As Integer

[0257] Dim plot_row, plot_time, plot_f, plot_m, plot_n As Integer

[0258] Rem: starting values for stepping

[0259] Rem: time is at the beginning of a pulse & step

[0260] t(0)=0

[0261] Rem: m is the count for the pulse that is executing

[0262] Rem: dm is applied at the end of a pulse . . . that is

[0263] Rem: the way point pulse is executed in full

[0264] m(0)=Int(F_clock/F_start)

[0265] f(0)=F_start

[0266] Rem: n is the count of pulses completed, starts at 0

[0267] n(0)=0

[0268] Rem: a_max is mid-point slope, da_dt is limit set by jerk timea_max=(F_end−F_start)/t_a

[0269] da_dt=a_max/t_j

[0270] Rem; f_j is frequency change associated with jerk time

[0271] f_j=0.5*a_max*t_j

[0272] Rem: a_f is acceleration, function of frequency

[0273] a_f=0

[0274] Rem: accumulator for all clocks in all pulses

[0275] m_sum(0)=0

[0276] Rem: set expectation for early dF steps along ramp

[0277] f_ratio=F_end/F_start

[0278] dF_factor=Exp(Log(f_ratio)/max_steps)

[0279] f_ddF=F_end * 0.5

[0280] Rem: ask about—can profile (speed, position settings) be changedpermanently from TD200?

[0281] Rem: Round Off Error Control

[0282] Rem: on each step, seek to re-establish correct SLOPE fromcurrent position

[0283] Rem: rather than close adherence to steps vs. time

[0284] Rem: choose next F for each step as dF/F*F (last step)

[0285] Rem: choose a (=dF/dt) for step as value for chosen F as idealresult

[0286] Rem: from applying da_dt

[0287] Rem: delta t for this step chosen as dF/a

[0288] Rem: dm (fixed point integer) determined to reach from actual m

[0289] Rem: of last step to new ideal m in ideal time dt

[0290] Rem: new m actual figured as n * dm added on to previous actual

[0291] Rem: new t actual figured from accumulated m

[0292] Rem: new f actual figured from m actual

[0293] slope_complete=False

[0294] step=0

[0295] Rem: main stepping loop−1 loop per way point

[0296] Do Until slope_complete

[0297] step=step+1

[0298] Rem: find the target frequency, time, counts, for end of step

[0299] Rem: clamp dF_factor for mid-range, then reduce for upper jerkregion

[0300] f(step)=f(step−1)*dF_factor

[0301] If f(step)>=0.99*F_end Then

[0302] f(step)=F_end

[0303] slope_complete=True

[0304] End If

[0305] Rem: current value of a(f), sub for a(t), determined separatelyfor

[0306] Rem: lowerjerk range

[0307] Rem: mid range

[0308] Rem: upper jerk range

[0309] Rem: first if covers F_end<2*f_j, hands control early to lastelse if

[0310] If f(step)<(f(0)+f_j) And f(step)<(F_end/2) Then

[0311] a_f=Sqr(2*(f(step)−f(0))*da_dt)

[0312] ElseIf f(step)<(F_end−f_j) Then a_f=a_max

[0313] ElseIf Not slope_complete Then

[0314] a_f=Sqr(2*(F_end−f(step−1))*da_dt)

[0315] dF_factor=1.01 +a_f/a_max*0.05

[0316] End If

[0317] Rem: find provisional time dt for next step to this target F

[0318] Rem: if needed, adjust step time>1 ms and>1 pulse time

[0319] Rem: if step time is increased to meet mins, adjust target F anddF_factor

[0320] dt=(f(step)−f(step−1))/a_f

[0321] If dt<0.001 Or (dt<(1/f(step−1))) Then

[0322] dt=max(0.001, 1/f(step−1))

[0323] t(step)=t(step−1)+dt

[0324] Rem: since t changed, choose next f for ideal adherence to t

[0325] f(step)=a_f*(t(step)−t(0))+f(0)

[0326] Rem adjust step ratio to reach final F from current step

[0327] f_ratio=F_end/f(step)

[0328] If step<>max_steps ThendF_factor=Exp(Log(f_ratio)/(max_steps−step))

[0329] Else

[0330] t(step)=t(step−1)+dt

[0331] End If

[0332] Rem: find next m for chosen f

[0333] m_ideal=F_clock/f(step)

[0334] Rem: find total clocks to next step

[0335] m_dt=dt*F_clock

[0336] Rem: average m/pulse to next step

[0337] m_bar=(m_ideal+m(step−1))/2

[0338] Rem: pulses to next step (dn) is total clocks divided by averagem

[0339] dn=Int(0.5+m_dt/m_bar)

[0340] n(step)=n(step−1)+dn

[0341] Rem: with new m and dn, find dm/pulse

[0342] Rem: change radix of dm fixed point to maintain precision

[0343] Do

[0344] dm(step−1)=Int(fix_shift*(m_ideal−m(step−1))/dn)

[0345] If (Abs(dm(step−1))<100) Then fix_shift=fix_shift*10

[0346] Loop Until Abs(dm(step−1))>=100

[0347] Cells(plot_row, plot_dm).Value=dm(step−1)

[0348] Rem: compute true m(step)and t(step) by adding up dm's ashardware will

[0349] m_fix=CLng(m(step−1))*fix_shift

[0350] m_sum(step)=m_sum(step−1)

[0351] plot_ref=m_fix

[0352] Rem: for each pulse, add dm to m, accumulate total clocks

[0353] For pulse=n(step−1)+1 To n(step)

[0354] m_sum(step)=m_sum(step)+Int(m_fix/fix_shift)

[0355] m_fix=m_fix+dm(step−1)

[0356] Next pulse

[0357] Rem: end for/next loop of pulses between steps (way_points)

[0358] Rem: replace ideal m and t for this step with actuals

[0359] m(step)=m_fix/fix_shift

[0360] f(step)=F_clock/m(step)

[0361] t(step)=m_sum(step)/F_clock

[0362] Loop

[0363] Rem: end looping on steps (way_points) until slope_complete

[0364] End Sub

[0365] Although the invention has been described with reference tospecific embodiments thereof, it will be understood that numerousvariations, modifications and additional embodiments are possible, andaccordingly, all such variations, modifications, and embodiments are tobe regarded as being within the spirit and scope of the invention. Forexample, programming of the motion module can occur over the Internet.Likewise, transmission of the pulse train can occur over the Internet.References specifically identified and discussed herein are incorporatedby reference as if fully set forth herein. Accordingly, the drawings anddescriptions are to be regarded as illustrative in nature, and not asrestrictive.

What is claimed is:
 1. A system, comprising: an arithmetic logic unit; amemory comprising a pre-computed table of target pulse widths, changesin pulse width, and pulse counts distributed according to a constrainedsemi-logarithmic distribution, said memory connected to said arithmeticlogic unit via a pipeline mechanism; and a state machine adapted to loadeach of said target pulse widths and changes in pulse width from saidmemory into said arithmetic logic unit at pre-determined intervals ofpulse count while maintaining control of a pulse width generated by saidarithmetic logic unit.
 2. The system of claim 1, wherein at least aportion of entries of said table are constrained by a maximum motionparameter.
 3. The system of claim 1, wherein said constrainedsemi-logarithmic distribution includes a plurality of targetfrequencies.
 4. The system of claim 1, further comprising a motiondevice coupled to said arithmetic logic unit.
 5. The system of claim 1,further comprising a motion device coupled via the Internet to saidarithmetic logic unit.
 6. The system of claim 1, wherein said statemachine is integral to a programmable logic controller.
 7. A system,comprising: an arithmetic logic unit; a memory comprising a pre-computedtable of target pulse widths that vary according to a constrainedsemi-logarithmic distribution, said memory connected to said arithmeticlogic unit via a pipeline mechanism; and a state machine adapted to loadeach of said target pulse widths from said memory into said arithmeticlogic unit at pre-determined intervals while maintaining control of apulse width generated by said arithmetic logic unit.
 8. The system ofclaim 7, wherein at least a portion of said target pulse widths areconstrained by a maximum motion parameter.
 9. The system of claim 7,wherein said constrained semi-logarithmic distribution relates to aplurality of target frequencies.
 10. The system of claim 7, furthercomprising a motion device coupled to said arithmetic logic unit. 11.The system of claim 7, further comprising a motion device coupled viathe Internet to said arithmetic logic unit.
 12. The system of claim 7,wherein said state machine is integral to a programmable logiccontroller.
 13. A system, comprising: an arithmetic logic unit; a memorycomprising a pre-computed table of target pulse widths distributedaccording to a constrained semi-logarithmic distribution, each of saidtarget pulse widths having a corresponding target pulse count, saidmemory connected to said arithmetic logic unit via a pipeline mechanism;and a state machine adapted to load each of said target pulse widthsfrom said memory into said arithmetic logic unit at pre-determinedintervals, which intervals are indefinitely deferrable, interruptible,and re-initiable by command or external event, while maintaining controlof a pulse width generated by said arithmetic logic unit.
 14. The systemof claim 13, wherein at least a portion of said target pulse widths areconstrained by a maximum motion parameter.
 15. The system of claim 13,wherein said constrained semi-logarithmic distribution relates to aplurality of target frequencies.
 16. The system of claim 13, furthercomprising a motion device coupled to said arithmetic logic unit. 17.The system of claim 13, further comprising a motion device coupled viathe Internet to said arithmetic logic unit.
 18. The system of claim 13,wherein said state machine is integral to a programmable logiccontroller.